<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<!--嵌套css-->
	<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>
	<link type="text/css" rel="stylesheet" href="css/AdminLTE.min.css"/>
	<link type="text/css" rel="stylesheet" href="css/skins/_all-skins.min.css"/>
	<link type="text/css" rel="stylesheet" href="css/font-awesome.min.css"/>
	<link type="text/css" rel="stylesheet" href="css/temp.css"/>
	<title>照片墙后台</title>
</head>
<body class="skin-blue sidebar-mini sidebar-collapse">
	<div id="wrapper"></div>
<!--嵌套js-->
<script type="text/javascript" src="js/jQuery-2.1.4.min.js"></script>
<script type="text/javascript" src="js/underscore.min.js"></script>
<script type="text/javascript" src="js/backbone.min.js"></script>
<script type="text/javascript" src="js/react.js"></script>
<script type="text/javascript" src="js/react-dom.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="js/app.min.js"></script>
<script type="text/javascript" src="js/wrapper.js"></script>
<script type="text/javascript" src="js/router.js"></script>
<!--本页js-->
<script type="text/javascript" src="js/moment.min.js"></script>
<script type="text/javascript" src="js/user-list.js"></script>

<script>
	var wallId='5766d923efe64f6c664bcc4e';

	var AppMain=ReactDOM.render(React.createElement(parllayComponents.Wrapper, {
	getSideBar: function(sidebar){
		data=[
			{"url":"/console","name":"照片墙列表","icon":"fa-list-ul"},
			{"url":"/walls/create","name":"新建照片墙","icon":"fa-plus"}
		];
		setTimeout(function(){
			sidebar.setState({
				data:data
			})
		},0)
	}, 
	getSocialAccount: function(accounts){
		var self=this;
		$.ajax({
			type:'get',
			url:'/me/accounts',
			dataType:'json',
			success:function(data){
				if(data){
					self.wrapper.setState({
						accounts:data,
						accountLock:!!'<%= data.id %>'
					});
					var accountIndex=localStorage.getItem('account'),
						chosen=_.find(data,function(i,index){ return index==accountIndex}) || data[0];
					self.setSocialAccount(chosen)
				}
			}
		})
	},
	getUserInfo: function(user){
		var self=this;
		setTimeout(function(){
			user.setState({
				name: '<%= user.name %>',
				src: '<%= user.profile_image %>', //TODO: We should change the src to profile_image
				date:'2016年4月11日',
				used:'0G',
				total:'10G'
			})
		})
	}}),document.getElementById('wrapper'))
</script>
</body>
</html>